import {
	Http
} from "../utils/http";
export function getToken() {
	return uni.getStorageSync('token') ? 'Bearer ' + uni.getStorageSync('token') : ''
}
export function register(data) {
	return Http.request({
		url: 'register_v2',
		method: 'post',
		data
	});
}

export function loginApi(data) {
	return Http.request({
		url: 'login',
		method: 'post',
		data
	});
}

export function editPassword({
	oldPassword,
	newPassword
}) {
	return Http.request({
		url: 'system/user/profile/updatePwd?oldPassword=' + oldPassword + '&newPassword=' + newPassword,
		method: 'Put'
	});
}


export function getDocBus(data) {
	return Http.request({
		url: 'xidai/doc/list_v2',
		method: 'get',
		showLoading: false,
		data
	});
}


export function addDoc(data) {
	return Http.request({
		url: 'xidai/doc',
		method: 'post',
		data
	});
}


export function editDoc(data) {
	return Http.request({
		url: 'xidai/doc',
		method: 'put',
		data
	});
}
export function deleteDoc(id) {
	return Http.request({
		url: 'xidai/doc/' + id,
		method: 'delete'
	});
}
export function getInfo() {
	return Http.request({
		url: 'getInfo',
		method: 'get',
		showLoading: false
	});
}